Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

346
Vistas
Conflicting with parent property "description" in Swift

I'm using EVNetworkningObject of EVReflection library to serialize or deserialize json response from web service. It means I can't change the property name "description" as "description_" or something like that. At the same time, backend will not change their response property for me. How possibly can I fix this error?

enter image description here

The error message says

Getter for 'description' with Objective-C selector 'description' conflicts with getter for 'description' from superclass 'NSObject' with the same Objective-C selector

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

description is a property of the protocol named NSObjectProtocol of NSObject.

public var description: String { get }

So you can't initiate any variable with the same name in any NSObject subclasses.

For more please visit https://developer.apple.com/documentation/objectivec/nsobjectprotocol/1418746-description.

Please try either by initiating the variable with different names or by implementing with Codable protocol of what @vadian suggested in comments.

over 4 years ago · Santiago Trujillo Denunciar

0

The by far easiest work-around with be to rename the property. Ex: var announcementDescription : String?

over 4 years ago · Santiago Trujillo Denunciar

0

I assume you are using JSON decodable for getting JSON data. if so , You don't need to make your super class of type NSObject. The reason you are getting this error is because the name conflicts with getter for 'description' from superclass 'NSObject'. So make EVNetworking(which is your super class) object a class which conforms to only decodable protocol and not a class of type NSObject.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda